import { request } from '@/utils/request';
import { requestFy } from '@/utils/request';

// // 获取客户精简列表
// export function getCustList(data) {
// 	return request({
// 		url: '/queue/cust-mgr/get-simple-list',
// 		headers: {
// 			isToken: true
// 		},
// 		method: 'GET',
// 		data: data
// 	})
// }
// 获取供应商精简列表
export function getCustList(data) {
  return request({
    url: '/queue/cust-mgr/get-supplier-simple-list',
    headers: {
      isToken: true
    },
    method: 'GET',
    data: data
  });
}
// 获取手机号
export function getPhone(userId) {
  return requestFy({
    url: '/user-autor/find-userPhone/' + userId,
    headers: {
      isToken: true
    },
    method: 'GET'
    // data: data
  });
}
// 获取排号流程状态列表
export function getLineupStatus(params) {
  return request({
    url: '/queue/tenant-config/get-lineup-status-config',
    headers: {
      isToken: false
    },
    method: 'GET',
    params
  });
}

// 获取运单流程状态列表
export function getWaybillStatus(data) {
  return request({
    url: '/queue/tenant-config/get-waybill-status-config',
    headers: {
      isToken: false
    },
    method: 'GET',
    data: data
  });
}

// 检查是否绑定微信
export function getBindWxStatus(data) {
  return request({
    url: '/system/bindwx/bind-exist',
    headers: {
      isToken: false
    },
    method: 'GET',
    data: data
  });
}

//解绑微信
export function getUnbindWx(data) {
  return request({
    url: '/system/bindwx/unbind-wxuser',
    headers: {
      isToken: false
    },
    method: 'POST',
    data: data
  });
}

//绑定微信
export function getBindWx(data) {
  return request({
    url: `/system/bindwx/bind-wxuser?openId=${data}`,
    headers: {
      isToken: false
    },
    method: 'POST',
    data: data
  });
}

// 使用用户名，获得租户编号
export function getTernantIdByUserName(data) {
  return request({
    url: `/system/tenant/get-id-by-username?userName=${data}`,
    method: 'GET'
  });
}

// 使用用户openId，获得租户编号
export function getTernantIdByOpenId(data) {
  return request({
    url: `/system/tenant/get-id-by-openid?openId=${data}`,
    headers: {
      isToken: false
    },
    method: 'GET'
  });
}
// 获得煤种
export function getCoalLists(data) {
  return requestFy({
    // url: `/queue/coal-type-mgr/get-simple-subtype-list`,
    url: `/purchase-management/get-product-by-purchaserId?purchaserId=${data}`,
    headers: {
      isToken: false
    },
    method: 'GET'
  });
}
//获得字典数据
export function getDictDatas() {
  return request({
    url: `/system/dict-data/list-all-simple`,
    headers: {
      isToken: true
    },
    method: 'GET'
  });
}
// 确认收货
export function confirmReceipt(data) {
  return requestFy({
    url: `/purchase-confirm/confirm-receipt`,
    headers: {
      isToken: false
    },
    method: 'POST',
    data: data
  });
}
// 取消运单
export function cancelPurOrderApi(id) {
  return requestFy({
    url: `/purchase-coal-send-car/purchaser-cancel-id/` + id,
    headers: {
      isToken: false
    },
    method: 'GET'
  });
}
//查询当前用户的按钮权限数据
export function getButtonShowApi(data) {
  return requestFy({
    url: `/user-autor/get-permission-info-from-applet`,
    headers: {
      isToken: false
    },
    method: 'POST',
    data: data
  });
}

// 获取账户余额
export function getAccountData() {
  return request({
    url: '/queue/supplier-account/get-account-data',
    headers: {
      isToken: false
    },
    method: 'GET'
  });
}
